package tech.kpretty.atomic;

import java.util.concurrent.atomic.AtomicInteger;

public class AtomicDemo {
    public static void main(String[] args) {
        AtomicInteger atomicInteger = new AtomicInteger(10);
        atomicInteger.compareAndSet(1,2);
        for (int i = 0; i < 10; i++) {
            System.out.println(atomicInteger.getAndIncrement());
        }
    }
}
